$(document).ready(function (){
    ajaxObj=new Object;
    ajaxObj.teaching_id=-1;
    ajaxObj.resources_id=-1;
    ajaxObj.url="";
    $('.teachingResourcesBox .teachingResourcesDownloadItem').click(function(){
        showTeachingDownloadInfo($(this));
    });
});
/**
 * show download information in the modal dialog
 * @author : nonglei
 * @date   : 06/05/2014
 */
function showTeachingDownloadInfo(elem)
{

    ajaxObj.teaching_id = elem.attr("teaching");
    ajaxObj.resources_id = elem.attr("resources");
    ajaxObj.url = elem.attr('actionUrl')+"/"+ajaxObj.teaching_id;
    var data = "ajax=1&&teaching="+ajaxObj.teaching_id+"&&resources="+ajaxObj.resources_id;
    var success = function(data){
        eval(data);
        $(".teachingResourcesBox #downloadTitle").html(data.title);
        $(".teachingResourcesBox #downloadContent").html(data.content);
        $(".teachingResourcesBox #downloadButton").attr("value",ajaxObj.resources_id);
    };
    var rs = ajaxConstruction(ajaxObj.url,data,"JSON",success);
}

